x86: discard type information when stealing pages
authorJan Beulich <jbeulich@suse.com>
Tue, 2 May 2017 11:18:38 +0000 (12:18 +0100)
committerIan Jackson <Ian.Jackson@eu.citrix.com>
Tue, 2 May 2017 11:18:38 +0000 (12:18 +0100)
commit8733567025e5095d178d6d294dbf0405d2250e37
treec10f6caf798b6f79fb1354facdec6c974e57403b
parent993a6534cae6d9ca2793799cfe369c9b3694ee1e
x86: discard type information when stealing pages

While a page having just a single general reference left necessarily
has a zero type reference count too, its type may still be valid (and
in validated state; at present this is only possible and relevant for
PGT_seg_desc_page, as page tables have their type forcibly zapped when
their type reference count drops to zero, and
PGT_{writable,shared}_page pages don't require any validation). In
such a case when the page is being re-used with the same type again,
validation is being skipped. As validation criteria differ between
32- and 64-bit guests, pages to be transferred between guests need to
have their validation indicator zapped (and with it we zap all other
type information at once).

This is XSA-214.

Reported-by: Jann Horn <jannh@google.com>
Signed-off-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
xen/arch/x86/mm.c